/*    */ package server.skill;
/*    */ 
/*    */ import client.MapleBuffStat;
/*    */ import handling.Buffstat;
/*    */ import java.io.Serializable;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import server.MapleStatEffect;
/*    */ import tools.data.output.MaplePacketLittleEndianWriter;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class MapleForeignBuffSkill
/*    */   implements Serializable
/*    */ {
/*    */   static final long serialVersionUID = 9179541993413739514L;
/*    */   private MapleStatEffect effect;
/*    */   private List<MapleForeignBuffStat> stats;
/*    */   
/*    */   private MapleForeignBuffSkill() {}
/*    */   
/*    */   public MapleForeignBuffSkill(MapleStatEffect effect) {
/* 29 */     this.effect = effect;
/* 30 */     this.stats = new ArrayList<>();
/*    */   }
/*    */   
/*    */   public MapleStatEffect getEffect() {
/* 34 */     return this.effect;
/*    */   }
/*    */   
/*    */   public List<MapleForeignBuffStat> getStats() {
/* 38 */     return this.stats;
/*    */   }
/*    */   
/*    */   public boolean hasStats() {
/* 42 */     synchronized (this) {
/* 43 */       for (MapleForeignBuffStat foreignBuffStat : this.stats) {
/* 44 */         if (!(foreignBuffStat instanceof MapleForeignBuffNoSkill)) {
/* 45 */           return true;
/*    */         }
/*    */       } 
/* 48 */       return false;
/*    */     } 
/*    */   }
/*    */   
/*    */   public void applyStat(MaplePacketLittleEndianWriter mplew, MapleBuffStat stat, int value) {
/* 53 */     synchronized (this) {
/* 54 */       for (MapleForeignBuffStat buffStat : this.stats) {
/* 55 */         if (buffStat.getStat().equals(stat) && (buffStat instanceof MapleForeignBuffNoSkill || !(buffStat instanceof MapleForeignBuffNoStat))) {
/* 56 */           buffStat.writePacket(mplew, value);
/*    */           break;
/*    */         } 
/*    */       } 
/*    */     } 
/*    */   }
/*    */   
/*    */   public boolean hasStat(Buffstat stat) {
/* 64 */     synchronized (this) {
/* 65 */       for (MapleForeignBuffStat buffStat : this.stats) {
/* 66 */         if (buffStat.getStat().equals(stat)) {
/* 67 */           return true;
/*    */         }
/*    */       } 
/* 70 */       return false;
/*    */     } 
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\server\skill\MapleForeignBuffSkill.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */